using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using WebFoundation;

namespace MHI.InspectionManager.Interfaces
{
	/// <summary>
	/// DevUserpositiondataT,table entity:dev_userpositiondata_t 
	/// </summary>
	public class DevUserpositiondataT
	{
		public static readonly string KeyId;
		public static readonly string KeyUserId;
		public static readonly string KeyJobId;
		public static readonly string KeyLocationTime;
		public static readonly string KeyLon;
		public static readonly string KeyLat;
		public static readonly string KeySpeed;
		public static readonly string KeyCellId;
		public static readonly string KeyAreaCode;
		public static readonly string KeyIsAbnormal;
		public static readonly string KeyGmtCreated;
		public static readonly string KeyGmtModified;
		public static readonly string KeyStateInfo;
		public static readonly string KeyIsUse;
		public static readonly string KeyVersion;
		

		static DevUserpositiondataT()
		{
			KeyId = ExpressionHelper.GetPropertyName<DevUserpositiondataT>(r => r.Id);
			KeyUserId = ExpressionHelper.GetPropertyName<DevUserpositiondataT>(r => r.UserId);
			KeyJobId = ExpressionHelper.GetPropertyName<DevUserpositiondataT>(r => r.JobId);
			KeyLocationTime = ExpressionHelper.GetPropertyName<DevUserpositiondataT>(r => r.LocationTime);
			KeyLon = ExpressionHelper.GetPropertyName<DevUserpositiondataT>(r => r.Lon);
			KeyLat = ExpressionHelper.GetPropertyName<DevUserpositiondataT>(r => r.Lat);
			KeySpeed = ExpressionHelper.GetPropertyName<DevUserpositiondataT>(r => r.Speed);
			KeyCellId = ExpressionHelper.GetPropertyName<DevUserpositiondataT>(r => r.CellId);
			KeyAreaCode = ExpressionHelper.GetPropertyName<DevUserpositiondataT>(r => r.AreaCode);
			KeyIsAbnormal = ExpressionHelper.GetPropertyName<DevUserpositiondataT>(r => r.IsAbnormal);
			KeyGmtCreated = ExpressionHelper.GetPropertyName<DevUserpositiondataT>(r => r.GmtCreated);
			KeyGmtModified = ExpressionHelper.GetPropertyName<DevUserpositiondataT>(r => r.GmtModified);
			KeyStateInfo = ExpressionHelper.GetPropertyName<DevUserpositiondataT>(r => r.StateInfo);
			KeyIsUse = ExpressionHelper.GetPropertyName<DevUserpositiondataT>(r => r.IsUse);
			KeyVersion = ExpressionHelper.GetPropertyName<DevUserpositiondataT>(r => r.Version);
		}
		

		private long _id; 
		private long? _userId; 
		private long? _jobId; 
		private DateTime? _locationTime; 
		private decimal? _lon; 
		private decimal? _lat; 
		private decimal? _speed; 
		private string _cellId; 
		private string _areaCode; 
		private byte? _isAbnormal; 
		private DateTime? _gmtCreated; 
		private DateTime? _gmtModified; 
		private float? _stateInfo; 
		private int _isUse; 
		private long _version; 
		

		/// <summary>
		///  Id, column: id required
		/// </summary>
		[DisplayName("编码")]
		[Required]
		public long Id
		{
			get{ return _id; }
			set
			{
				if(_id != value)
				{
					_id = value;
					NotifyOfChange(KeyId);
				}
			}
		}

		/// <summary>
		///  UserId, column: user_id 
		/// </summary>
		[DisplayName("用户")]
		public long? UserId
		{
			get{ return _userId; }
			set
			{
				if(_userId != value)
				{
					_userId = value;
					NotifyOfChange(KeyUserId);
				}
			}
		}

		/// <summary>
		///  JobId, column: job_id 
		/// </summary>
		[DisplayName("工单ID")]
		public long? JobId
		{
			get{ return _jobId; }
			set
			{
				if(_jobId != value)
				{
					_jobId = value;
					NotifyOfChange(KeyJobId);
				}
			}
		}

		/// <summary>
		///  LocationTime, column: location_time 
		/// </summary>
		[DisplayName("位置时间")]
		public DateTime? LocationTime
		{
			get{ return _locationTime; }
			set
			{
				if(_locationTime != value)
				{
					_locationTime = value;
					NotifyOfChange(KeyLocationTime);
				}
			}
		}

		/// <summary>
		///  Lon, column: lon 
		/// </summary>
		[DisplayName("经度")]
		public decimal? Lon
		{
			get{ return _lon; }
			set
			{
				if(_lon != value)
				{
					_lon = value;
					NotifyOfChange(KeyLon);
				}
			}
		}

		/// <summary>
		///  Lat, column: lat 
		/// </summary>
		[DisplayName("纬度")]
		public decimal? Lat
		{
			get{ return _lat; }
			set
			{
				if(_lat != value)
				{
					_lat = value;
					NotifyOfChange(KeyLat);
				}
			}
		}

		/// <summary>
		///  Speed, column: speed 
		/// </summary>
		[DisplayName("速度")]
		public decimal? Speed
		{
			get{ return _speed; }
			set
			{
				if(_speed != value)
				{
					_speed = value;
					NotifyOfChange(KeySpeed);
				}
			}
		}

		/// <summary>
		///  CellId, column: cell_id 
		/// </summary>
		[DisplayName("所在单元")]
		public string CellId
		{
			get{ return _cellId; }
			set
			{
				if(_cellId != value)
				{
					_cellId = value;
					NotifyOfChange(KeyCellId);
				}
			}
		}

		/// <summary>
		///  AreaCode, column: area_code 
		/// </summary>
		[DisplayName("所在区域")]
		public string AreaCode
		{
			get{ return _areaCode; }
			set
			{
				if(_areaCode != value)
				{
					_areaCode = value;
					NotifyOfChange(KeyAreaCode);
				}
			}
		}

		/// <summary>
		///  IsAbnormal, column: is_abnormal 
		/// </summary>
		[DisplayName("是否正常")]
		public byte? IsAbnormal
		{
			get{ return _isAbnormal; }
			set
			{
				if(_isAbnormal != value)
				{
					_isAbnormal = value;
					NotifyOfChange(KeyIsAbnormal);
				}
			}
		}

		/// <summary>
		///  GmtCreated, column: gmt_created 
		/// </summary>
		[DisplayName("创建时间")]
		public DateTime? GmtCreated
		{
			get{ return _gmtCreated; }
			set
			{
				if(_gmtCreated != value)
				{
					_gmtCreated = value;
					NotifyOfChange(KeyGmtCreated);
				}
			}
		}

		/// <summary>
		///  GmtModified, column: gmt_modified 
		/// </summary>
		[DisplayName("更新时间")]
		public DateTime? GmtModified
		{
			get{ return _gmtModified; }
			set
			{
				if(_gmtModified != value)
				{
					_gmtModified = value;
					NotifyOfChange(KeyGmtModified);
				}
			}
		}

		/// <summary>
		///  StateInfo, column: state_info 
		/// </summary>
		[DisplayName("标识状态")]
		public float? StateInfo
		{
			get{ return _stateInfo; }
			set
			{
				if(_stateInfo != value)
				{
					_stateInfo = value;
					NotifyOfChange(KeyStateInfo);
				}
			}
		}

		/// <summary>
		///  IsUse, column: is_use 
		/// </summary>
		[DisplayName("是否可用")]
		[Required]
		public int IsUse
		{
			get{ return _isUse; }
			set
			{
				if(_isUse != value)
				{
					_isUse = value;
					NotifyOfChange(KeyIsUse);
				}
			}
		}

		/// <summary>
		///  Version, column: version 
		/// </summary>
		[DisplayName("版本")]
		[Required]
		public long Version
		{
			get{ return _version; }
			set
			{
				if(_version != value)
				{
					_version = value;
					NotifyOfChange(KeyVersion);
				}
			}
		}

		public event PropertyChangedEventHandler PropertyChanged;

		private void NotifyOfChange(string propertyName)
		{
			if (this.PropertyChanged != null)
			{
				this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
			}
		}
	}
}
